import React,{lazy}from 'react'
import {Routes,Route,NavLink,Navigate} from 'react-router-dom'
import Cate from './cate'
import Cart from './cart'
import Mine from './mine'
import Home from './home'
import '../assets/css/index.css'
class Index extends React.Component {
    render() {
        return (<div>
            <Routes>
              <Route path='cate' element={<Cate/>}></Route>
                <Route path='cart' element={<Cart/>}></Route>
                <Route path='mine' element={<Mine/>}></Route>
             <Route path='home' element={<Home/>}></Route>
             <Route path='' element={<Navigate to='home'></Navigate>}></Route>
             {/* 重定向 */}
            </Routes>
              {/* 导航栏 */}
              <div className='bottom'>
             <NavLink to='/index/home' className='li'>首页</NavLink>
             <NavLink to='/index/cate' className='li'>分类</NavLink>
             <NavLink to='/index/cart' className='li'>购物车</NavLink>
             <NavLink to='/index/mine' className='li'>个人中心</NavLink>
              </div>
        </div>)
    }
}
export default Index